import { Component } from '@angular/core';
import {NavController, NavParams } from 'ionic-angular';
import {HttpServies} from '../../providers/http-servies';

@Component({
  selector: 'page-content',
  templateUrl: 'content.html',
    providers:[HttpServies]
})
export class ContentPage {
    dataJson:any=[];
    id="";

  constructor(public navCtrl: NavController, private http:HttpServies,public navParams: NavParams) {
      this.id = this.navParams.get('id');
  }

  ionViewDidLoad() {
      this.getInfo();
  }
    getInfo(){
        var param = "id="+this.id;
        this.http.httpPost('/Home/index/news_details',param)
            .then(res => {
                if (res && res.code == 1) {
                    console.log(res.msg);
                    this.dataJson = res.data;
                }else {
                    this.http.showErro(res.msg);
                }
            })
    }
}
